<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

if(!defined('TinyFW')) exit('Access denied!');

class tfFormTextArea extends tfFormElement {
    
    
    private $_cols;
    private $_rows;
    private $_value;

    public function  __construct( $name='', $id='',$caption='', $value='', $rows=5, $cols=50, $attr_arr = '') {

        $this->setCaption($caption);
        $this->setName($name);
        if($id != '') {
            $this->setId($id);
        }
        $this->setValue($value);
        $this->_rows = $rows;
        $this->_cols = $cols;

        if(!empty($attr_arr)) {
            $this->setAttr($attr_arr);
        }

    }


    public function getRows(){
        return $this->_rows;
    }

    public function getCols(){
        return $this->_cols;
    }


    public function render(){
        return "<textarea name='" . $this->getName() . "' id='" . $this->getId() . "' cols='" . $this->getCols() . "' rows='" . $this->getRows() . "' " . $this->getAttrStr() . " >" . $this->getValue() . "</textarea>\r\n";
    }

    /*
    public function  __toString() {
        return $this->render();
    }
    */

}

?>
